@extends('admin.layouts.base')

@section('title','控制面板')

@section('pageHeader','控制面板')

@section('pageDesc','DashBoard')

@section('content')
    上次刷新时间：<span class="text-danger text-bold">{{date('Y-m-d H:i')}}</span> ，五分钟后自动刷新

    <!-- 操作导航 -->
    @include('admin.index.opMenu')
    <section class="content">
        <!-- Small boxes (Stat box) -->
        <h1>Copy</h1>
        <div class="row">
            <div class="col-lg-3 col-xs-6">
                <!-- small box -->
                <div class="small-box bg-aqua">
                    <div class="inner">
                        <h3>{{$today['cp_count']}}</h3>

                        <p>CopyCount</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-bag"></i>
                    </div>
                    <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
            <!-- ./col -->
            <div class="col-lg-3 col-xs-6">
                <!-- small box -->
                <div class="small-box bg-green">
                    <div class="inner">
                        <h3>{{$today['cp_only_count']}}<sup style="font-size: 20px"></sup></h3>

                        <p>onlyCopy</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-stats-bars"></i>
                    </div>
                    <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
            <!-- ./col -->
            <div class="col-lg-3 col-xs-6">
                <!-- small box -->
                <div class="small-box bg-yellow">
                    <div class="inner">
                        <h3>{{$today['cp_last_five_minutes_count']}}</h3>
                        <p>lastFiveMinutesCopy</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-person-add"></i>
                    </div>
                    <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
            <!-- ./col -->
            <div class="col-lg-3 col-xs-6">
                <!-- small box -->
                <div class="small-box bg-red">
                    <div class="inner">
                        <h3>{{$today['cp_last_hour_count']}}</h3>

                        <p>lastHourCopy</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-pie-graph"></i>
                    </div>
                    <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
            <!-- ./col -->
        </div>
        <!-- /.row -->

        <h1>Originate</h1>
        <div class="row">
            <div class="col-lg-3 col-xs-6">
                <!-- small box -->
                <div class="small-box bg-aqua">
                    <div class="inner">
                        <h3>{{$today['originate_count']}}</h3>

                        <p>OriginateCount</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-bag"></i>
                    </div>
                    <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
            <!-- ./col -->
            <div class="col-lg-3 col-xs-6">
                <!-- small box -->
                <div class="small-box bg-green">
                    <div class="inner">
                        <h3>{{$today['originate_only_count']}}<sup style="font-size: 20px"></sup></h3>

                        <p>onlyOriginate</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-stats-bars"></i>
                    </div>
                    <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
            <!-- ./col -->
            <div class="col-lg-3 col-xs-6">
                <!-- small box -->
                <div class="small-box bg-yellow">
                    <div class="inner">
                        <h3>{{$today['originate_last_five_minutes_count']}}</h3>
                        <p>lastFiveMinutesOriginate</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-person-add"></i>
                    </div>
                    <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
            <!-- ./col -->
            <div class="col-lg-3 col-xs-6">
                <!-- small box -->
                <div class="small-box bg-red">
                    <div class="inner">
                        <h3>{{$today['originate_last_hour_count']}}</h3>

                        <p>lastHourOriginate</p>
                    </div>
                    <div class="icon">
                        <i class="ion ion-pie-graph"></i>
                    </div>
                    <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
            <!-- ./col -->
        </div>

        <!-- /.row -->
        <h1>Channel&Template</h1>
        <div class="row">
            <div class="col-lg-6 col-xs-12">
                <div class="box">
                    <div class="box-header">
                      <h3 class="box-title">ChannelOriginateStatistics</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body no-padding">
                      <table class="table table-condensed">
                        <tbody><tr>
                          <th>#</th>
                          <th>Channel</th>
                          <th>Count</th>
                          <th>Progress</th>
                          <th>Percent</th>
                        </tr>
                        @foreach($today['originate_channel_statistics'] as $key=>$obj)
                        <tr>
                          <td>{{$key +1}}.</td>
                          <td>{{$obj->channel}}</td>
                          <td>{{$obj->count}}</td>
                          <td>
                            <div class="progress progress-xs">
                              <div class="progress-bar progress-bar-danger" style="width: {{round($obj->count / $today['originate_count'] * 100,0) }}%"></div>
                            </div>
                          </td>
                          <td><span class="badge @if($key % 4 ===1) bg-red @elseif($key % 4 ===2) bg-yellow @elseif($key % 4 ===3) bg-light-blue @elseif($key % 4 ===0) bg-green @endif">{{round($obj->count / $today['originate_count'] * 100,0)  }}%</span></td>
                        </tr>
                        @endforeach
                        
                      </tbody></table>
                    </div>
                    <!-- /.box-body -->
                  </div>
            </div>

            <div class="col-lg-6 col-xs-12">
                <div class="box">
                    <div class="box-header">
                      <h3 class="box-title">TemplateCopyStatistics</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body no-padding">
                      <table class="table table-condensed">
                        <tbody>
                        <tr>
                          <th>#</th>
                          <th>Template</th>
                          <th>Progress</th>
                          <th>Count</th>
                          <th>Percent</th>
                        </tr>
                        @foreach($today['cp_template_statistics'] as $key=>$obj)
                        <tr>
                          <td>{{$key +1}}.</td>
                          <td>{{$obj->template}}</td>
                          <td>
                            <div class="progress progress-xs">
                              <div class="progress-bar progress-bar-danger" style="width: {{round($obj->count / $today['cp_count'] * 100,0) }}%"></div>
                            </div>
                          </td>
                          <td>{{$obj->count}}</td>
                          <td><span class="badge @if($key % 4 ===1) bg-red @elseif($key % 4 ===2) bg-yellow @elseif($key % 4 ===3) bg-light-blue @elseif($key % 4 ===0) bg-green @endif">{{round($obj->count / $today['cp_count'] * 100,0)  }}%</span></td>
                        </tr>
                        @endforeach
                        
                      </tbody></table>
                    </div>
                    <!-- /.box-body -->
                  </div>
            </div>
        </div>

        <!-- /.row -->
        <h1>AllData</h1>
        <div class="row">
            <!-- ./col -->
            <div class="col-lg-6 col-xs-12">
                <!-- small box -->
                <div class="box">
                    <div class="box-header">
                      <h3 class="box-title">Keyword</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body no-padding">
                      <table class="table table-striped">
                        <tbody>
                          <tr>
                            <th >#</th>
                            <th>Keyword</th>
                            <th >Count</th>
                            <th >Percent</th>
                          </tr>
                          @foreach($today['originate_today_keyword'] as $key=>$obj)
                          <tr>
                            <td>{{$key +1}}.</td>
                            <td><a href="?checkCopyKeywrod=yes&keyword={{$obj->keyword}}">{{$obj->keyword}}</a></td>
                            <td>{{$obj->count}}</td>
                            <td><span class="badge @if($key % 4 ===1) bg-red @elseif($key % 4 ===2) bg-yellow @elseif($key % 4 ===3) bg-light-blue @elseif($key % 4 ===0) bg-green @endif">{{round($obj->count / $today['originate_today_keyword_count'] * 100,0) }}%</span></td>
                          </tr>
                          @endforeach

                      </tbody></table>
                    </div>
                    <!-- /.box-body -->
                  </div>
            </div>
            <!-- ./col -->
            <div class="col-lg-6 col-xs-12">
                <!-- small box -->
                <div class="box">
                    <div class="box-header">
                      <h3 class="box-title">HistoryKeyword</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body no-padding">
                      <table class="table table-striped">
                        <tbody>

                          <tr>
                            <th>#</th>
                            <th>Keyword</th>
                            <th>Count</th>
                            <th>Percent</th>
                          </tr>
                          @foreach($today['originate_historical_keyword'] as $key=>$obj)
                          <tr>
                            <td>{{$key +1}}.</td>
                            <td><a href="?checkCopyKeywrod=yes&keyword={{$obj->keyword}}">{{$obj->keyword}}</a></td>
                            <td>{{$obj->count}}</td>
                            <td><span class="badge @if($key % 4 ===1) bg-red @elseif($key % 4 ===2) bg-yellow @elseif($key % 4 ===3) bg-light-blue @elseif($key % 4 ===0) bg-green @endif">{{round($obj->count / $today['originate_historical_keyword_count'] * 100,0) }}%</span></td>
                          </tr>
                          @endforeach

                      </tbody></table>
                    </div>
                    <!-- /.box-body -->
                  </div>
            </div>
            <!-- ./col -->

            <div class="col-lg-6 col-xs-12">
                <!-- small box -->
                <div class="box">
                    <div class="box-header">
                      <h3 class="box-title">CopyDataTheLast</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body no-padding">
                      <table class="table table-striped">
                        <tbody>
                            <tr>
                          <th>#</th>
                          <th class="hidden-xs">Channel</th>
                          <th class="hidden-xs">Domain</th>
                          <th>Template</th>
                          <th>CreateTime</th>
                          <th>Keyword</th>
                        </tr>
                            @foreach($today['cp_channel'] as $key1=>$obj)
                        <tr>
                          <td>{{$key +1}}.</td>
                          <td class="hidden-xs">{{$obj->channel}}</td>
                          <td class="hidden-xs">{{$obj->domain}}</td>
                          <td>{{$obj->template}}</td>
                          <td>{{$obj->created_at}}</td>
                          <td><a href="?checkCopyKeywrod=yes&keyword={{$obj->keyword}}">{{$obj->keyword}}</a></td>
                        </tr>

                        @endforeach
                      </tbody></table>
                    </div>
                    <!-- /.box-body -->
                  </div>
            </div>
            <div class="col-lg-6 col-xs-12">
                <div class="box">
                    <div class="box-header">
                      <h3 class="box-title">DomainCopyStatistics</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body no-padding">
                      <table class="table table-condensed">
                        <tbody>
                        <tr>
                          <th>#</th>
                          <th>Domain</th>
                          <th>Progress</th>
                          <th>Count</th>
                          <th>Percent</th>
                        </tr>
                        @foreach($today['cp_domain_statistics'] as $key=>$obj)
                        <tr>
                          <td>{{$key +1}}.</td>
                          <td>{{$obj->domain}}</td>
                          <td>
                            <div class="progress progress-xs">
                              <div class="progress-bar progress-bar-danger" style="width: {{round($obj->count / $today['cp_count'] * 100,0) }}%"></div>
                            </div>
                          </td>
                          <td>{{$obj->count}}</td>
                          <td><span class="badge @if($key % 4 ===1) bg-red @elseif($key % 4 ===2) bg-yellow @elseif($key % 4 ===3) bg-light-blue @elseif($key % 4 ===0) bg-green @endif">{{round($obj->count / $today['cp_count'] * 100,0)  }}%</span></td>
                        </tr>
                        @endforeach
                        
                      </tbody></table>
                    </div>
                    <!-- /.box-body -->
                  </div>
            </div>
            <!-- ./col -->
            <div class="col-lg-12 col-xs-12">
                <!-- small box -->
                <div class="box">
                    <div class="box-header">
                      <h3 class="box-title">SearchKeywordTheLast</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body no-padding">
                      <table class="table table-striped">
                        <tbody>
                        <tr>
                          <th>#</th>
                          <th class="hidden-xs">Channel</th>
                          <th>Domain</th>
                          <th class="hidden-xs">CreateTime</th>
                          <th>Keyword</th>
                        </tr>
                            @foreach($today['originate_keyword'] as $key=>$obj)
                        <tr>
                          <td>{{$key + 1}}</td>
                          <td class="hidden-xs">{{$obj->channel}}</td>
                          <td>{{$obj->domain}}</td>
                           <td class="hidden-xs">{{$obj->created_at}}</td>
                          <td><a href="?checkCopyKeywrod=yes&keyword={{$obj->keyword}}">{{$obj->keyword}}</a></td>
                        </tr>

                        @endforeach
                      </tbody></table>
                    </div>
                    <!-- /.box-body -->
                  </div>
            </div>
        </div>
        <!-- /.row -->
    </section>

@endsection


@section('js')

@endsection
{{header("Refresh: 300")}}